<template>
  <div>
    <div>
      <select-info ref="selectInfo" @callBack="callBack"></select-info>
    </div>
    <div>
      <pdf-excel :dataInfo="dataInfo" ref="pdfExcel"></pdf-excel>
    </div>
  </div>
</template>
<script>
import PdfExcel from '@/components/pdf-excel'
import SelectInfo from '../components/select-info'

export default {
  name: 'grid-sw-statistics',
  components: {
    PdfExcel, SelectInfo
  },
  data () {
    return {
      dataInfo: {
        url: 'http://qstb.mzj.shenyang.gov.cn/api/ac/grid/swResidentialUserService/exportSw',
        params: {},
        type1: 'pdf',
        type2: 'excel'
      }
    }
  },
  methods: {
    // 下拉回调
    callBack (e) {
      // this.dataInfo.params = e
      let n = {}
      switch (e.grade) {
        case '5.5':
          n.residential_id = e.id
          n.community_id = e.community_id
          n.street_id = e.street_id
          break
        case '5':
          n.community_id = e.id
          n.street_id = e.parent_id
          break
        case '4':
          n.street_id = e.id
          break
        case '3':
          n.area_id = e.id
          break
        case '2':
          n.shi = e.id
          break
      }
      this.$refs.pdfExcel.select(n)
      console.log(e, 'lllllll')
    }
  },
  mounted () {
    this.severUserInfo = this.$store.state.user.severUserInfo
  }
}
</script>

<style scoped>
</style>
